Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added feature: Header auto hide and unhide as user scroll. #363

Closed
wants to merge 4 commits into from

Conversation

HusainModiwala
Copy link
Contributor

PR Fixes:

  • 1 added feature: Header auto hide and unhide as user scroll.

Resolves #361

Checklist before requesting a review

  • I have performed a self-review of my code
  • I assure there is no similar/duplicate pull request regarding same issue

}

// remember current page location to use in the next move
setLastScrollY(window.scrollY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this not causing an infinite loop?
You're updating the lastScrollY here and have it as a dependency to the effect?
Is it because it's the same the second time?
Doesn't matter but we should confirm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you are correct it is causing an issue. Actually I had added the useCallback after I was done testing the change. And then forgot to test again. Will correct and update. Sorry for the inconvinience.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still dont see a useCallback here?
This will cause the effect to run on every render

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but using useCallback was causing infinite loop and it was not rendering that's why I removed that.

@HusainModiwala
Copy link
Contributor Author

@hkirat I have resolved the issue and now it's working fine as I have tested it. Kindly have a look. Thanks !

@HusainModiwala
Copy link
Contributor Author

@hkirat can you have a look please. If all good I can merge

@HusainModiwala
Copy link
Contributor Author

@hkirat pls have a look

@hkirat
Copy link
Contributor

hkirat commented Jun 2, 2024

not needed I think, this got added in dailycode and becomes jarring if anything

@hkirat hkirat closed this Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Header auto hide and unhide as user scroll.
2 participants